/+
SQLite.3.3.17 proxy header for unit testing.

This module provides replacement SQLite methods for testing interface calls.

--------------------------------------------------------------------------------

Library dbapi - Simple database api for the D programming language.

Copyright (C) 2007 Myron Alexander (myron.alexander...gmail.com)

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+/

module dbapi.internal.sqlite3.test.header;

private static import sqlite.sqlite3;

//------------------------------------------------------------------------------
// Pass on the opaque structures and defines to the module caller.
//------------------------------------------------------------------------------

// TODO - Think about how to use the my structures instead of the sqlite3 ones
//        to configure the tests. 
alias sqlite.sqlite3.sqlite3_stmt   sqlite3_stmt;
alias sqlite.sqlite3.sqlite3        sqlite3;

// Import types
alias sqlite.sqlite3.sqlite_int64   sqlite_int64;

// Import error constants
alias sqlite.sqlite3.SQLITE_OK                  SQLITE_OK;
alias sqlite.sqlite3.SQLITE_ERROR               SQLITE_ERROR;
alias sqlite.sqlite3.SQLITE_INTERNAL            SQLITE_INTERNAL;
alias sqlite.sqlite3.SQLITE_PERM                SQLITE_PERM;
alias sqlite.sqlite3.SQLITE_ABORT               SQLITE_ABORT;
alias sqlite.sqlite3.SQLITE_BUSY                SQLITE_BUSY;
alias sqlite.sqlite3.SQLITE_LOCKED              SQLITE_LOCKED;
alias sqlite.sqlite3.SQLITE_NOMEM               SQLITE_NOMEM;
alias sqlite.sqlite3.SQLITE_READONLY            SQLITE_READONLY;
alias sqlite.sqlite3.SQLITE_INTERRUPT           SQLITE_INTERRUPT;
alias sqlite.sqlite3.SQLITE_IOERR               SQLITE_IOERR;
alias sqlite.sqlite3.SQLITE_CORRUPT             SQLITE_CORRUPT;
alias sqlite.sqlite3.SQLITE_NOTFOUND            SQLITE_NOTFOUND;
alias sqlite.sqlite3.SQLITE_FULL                SQLITE_FULL;
alias sqlite.sqlite3.SQLITE_CANTOPEN            SQLITE_CANTOPEN;
alias sqlite.sqlite3.SQLITE_PROTOCOL            SQLITE_PROTOCOL;
alias sqlite.sqlite3.SQLITE_EMPTY               SQLITE_EMPTY;
alias sqlite.sqlite3.SQLITE_SCHEMA              SQLITE_SCHEMA;
alias sqlite.sqlite3.SQLITE_TOOBIG              SQLITE_TOOBIG;
alias sqlite.sqlite3.SQLITE_CONSTRAINT          SQLITE_CONSTRAINT;
alias sqlite.sqlite3.SQLITE_MISMATCH            SQLITE_MISMATCH;
alias sqlite.sqlite3.SQLITE_MISUSE              SQLITE_MISUSE;
alias sqlite.sqlite3.SQLITE_NOLFS               SQLITE_NOLFS;
alias sqlite.sqlite3.SQLITE_AUTH                SQLITE_AUTH;
alias sqlite.sqlite3.SQLITE_FORMAT              SQLITE_FORMAT;
alias sqlite.sqlite3.SQLITE_RANGE               SQLITE_RANGE;
alias sqlite.sqlite3.SQLITE_NOTADB              SQLITE_NOTADB;
alias sqlite.sqlite3.SQLITE_ROW                 SQLITE_ROW;
alias sqlite.sqlite3.SQLITE_DONE                SQLITE_DONE;

alias sqlite.sqlite3.SQLITE_IOERR_READ          SQLITE_IOERR_READ;
alias sqlite.sqlite3.SQLITE_IOERR_SHORT_READ    SQLITE_IOERR_SHORT_READ;
alias sqlite.sqlite3.SQLITE_IOERR_WRITE         SQLITE_IOERR_WRITE;
alias sqlite.sqlite3.SQLITE_IOERR_FSYNC         SQLITE_IOERR_FSYNC;
alias sqlite.sqlite3.SQLITE_IOERR_DIR_FSYNC     SQLITE_IOERR_DIR_FSYNC;
alias sqlite.sqlite3.SQLITE_IOERR_TRUNCATE      SQLITE_IOERR_TRUNCATE;
alias sqlite.sqlite3.SQLITE_IOERR_FSTAT         SQLITE_IOERR_FSTAT;
alias sqlite.sqlite3.SQLITE_IOERR_UNLOCK        SQLITE_IOERR_UNLOCK;
alias sqlite.sqlite3.SQLITE_IOERR_RDLOCK        SQLITE_IOERR_RDLOCK;
alias sqlite.sqlite3.SQLITE_IOERR_DELETE        SQLITE_IOERR_DELETE;

// Import value types
alias sqlite.sqlite3.SQLITE_INTEGER             SQLITE_INTEGER;
alias sqlite.sqlite3.SQLITE_FLOAT               SQLITE_FLOAT;
alias sqlite.sqlite3.SQLITE_TEXT                SQLITE_TEXT;
alias sqlite.sqlite3.SQLITE_BLOB                SQLITE_BLOB;
alias sqlite.sqlite3.SQLITE_NULL                SQLITE_NULL;

// Import destructor methods
alias sqlite.sqlite3.SQLITE_STATIC              SQLITE_STATIC;
alias sqlite.sqlite3.SQLITE_TRANSIENT           SQLITE_TRANSIENT;

//------------------------------------------------------------------------------
// Define the proxy methods.
//------------------------------------------------------------------------------

extern (C)
{

int sqlite3_close (sqlite3* db) {
   return 1;
}

int sqlite3_open (char* filename, sqlite3** ppDb) {
   return 1;
}

int sqlite3_prepare_v2 (   sqlite3*       db
                         , char*          zSql
                         , int            nBytes
                         , sqlite3_stmt** ppStmt
                         , char**         pzTail) {

   return 1;
}

int sqlite3_column_count (sqlite3_stmt* pStmt) {
   return 1;
}

int sqlite3_bind_parameter_count (sqlite3_stmt* pStmt) {
   return 1;
}

int sqlite3_step (sqlite3_stmt* pStmt) {
   return 1;
}

int sqlite3_data_count (sqlite3_stmt* pStmt) {
   return 1;
}

int  sqlite3_reset (sqlite3_stmt* pStmt) {
   return 1;
}

int sqlite3_finalize (sqlite3_stmt* pStmt) {
   return 1;
}

int  sqlite3_changes(sqlite3* db) {
   return 1;
}

int  sqlite3_clear_bindings (sqlite3_stmt* pStmt) {
   return 1;
}

int sqlite3_bind_parameter_index (sqlite3_stmt* pStmt, char* zName) {
   return 1;
}

int sqlite3_bind_blob (   sqlite3_stmt*         pStmt
                        , int                   idx
                        , void*                 value
                        , int                   n
                        , void function(void*)  destructor) {
   return 1;
}

int sqlite3_bind_double (sqlite3_stmt* pStmt, int idx, double value) {
   return 1;
}

int sqlite3_bind_int (sqlite3_stmt* pStmt, int idx, int value) {
   return 1;
}

int sqlite3_bind_int64 (sqlite3_stmt* pStmt, int idx, sqlite_int64 value) {
   return 1;
}

int sqlite3_bind_null (sqlite3_stmt* pStmt, int idx) {
   return 1;
}

int sqlite3_bind_text (   sqlite3_stmt*         pStmt
                        , int                   idx
                        , char*                 value
                        , int                   n
                        , void function(void*)  destructor) {
   return 1;
}

char* sqlite3_column_name (sqlite3_stmt* pStmt, int iCol) {
   return null;
}

char* sqlite3_column_decltype (sqlite3_stmt* pStmt, int iCol) {
   return null;
}

int sqlite3_column_type (sqlite3_stmt* pStmt, int iCol) {
   return 1;
}

sqlite_int64 sqlite3_column_int64 (sqlite3_stmt* pStmt, int iCol) {
   return 1;
}

double sqlite3_column_double (sqlite3_stmt* pStmt, int iCol) {
   return 1;
}

char* sqlite3_column_text (sqlite3_stmt* pStmt, int iCol) {
   return null;
}

void* sqlite3_column_blob (sqlite3_stmt* pStmt, int iCol) {
   return null;
}

int sqlite3_column_bytes (sqlite3_stmt* pStmt, int iCol) {
   return 1;
}

char* sqlite3_errmsg (sqlite3* db) {
   return null;
}

int sqlite3_errcode (sqlite3*db) {
   return 1;
}

int sqlite3_get_autocommit (sqlite3* db) {
   return 1;
}

} // End extern (C)